from django.contrib import admin
from .models import Post,Comment
# Register your models here.
#在这儿你可以注册你的模型(model)并将它们包含到Django的管理页面中


class PostAdmin(admin.ModelAdmin):
	list_display = ('title','slug','author','publish','status')
	list_filter = ('status','created','publish','author')
	search_fields = ('title','body')
	#prepopulated_fields = ('author')
	date_hierarchy = 'publish'
	ordering = ['status','publish']
admin.site.register(Post,PostAdmin)

class CommentAdmin(admin.ModelAdmin):
	list_display = ('name','email','post','created','active')
	list_filter = ('active','created','updated')
	search_fields = ('name','email','body')
admin.site.register(Comment,CommentAdmin)